package main.java.com.login.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import main.java.com.login.service.UserLoginService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.support.RequestContextUtils;

@Controller
@RequestMapping("/sys")
public class UserLoginController {
	
	@Resource
	private UserLoginService userLoginService;
	
	@RequestMapping("/login.do")
	public String UserLogin(String userName,String password,HttpServletRequest request){
		@SuppressWarnings("unused")
//		WebApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
		WebApplicationContext applicationContext2 = RequestContextUtils.getWebApplicationContext(request);
		String successJsp = userLoginService.successJsp();
		return successJsp;
	}

}
